import java.util.Timer;
import java.util.TimerTask;

public class Main {
    public static void main(String[] args) {
        Timer timer = new Timer();

        TimerTask task1 = new TimerTask() {
            @Override
            public void run() {
                System.out.println("run task1");
            }
        };
        TimerTask task2 = new TimerTask() {
            @Override
            public void run() {
                System.out.println("run task2");
            }
        };
        TimerTask task3 = new TimerTask() {
            @Override
            public void run() {
                System.out.println("run task3");
            }
        };

        timer.schedule(task1,1000);
        timer.schedule(task2,2000);
        timer.schedule(task3,3000);


    }
}